using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;

namespace InvestmentIntelligence.DbModel.Models
{
    public class CompassTradeToInvestment
    {
        public int TradeId { get; set; }

        public int InvestmentId { get; set; }
    }
    
    public class Investment
    {
        public Investment()
        {
            RiskSeries = new List<InvestmentRiskSerie>();
            SecuritySeries = new List<InvestmentSecuritySerie>();
            SecurityUnderlyingSeries = new List<InvestmentSecurityUnderlyingSerie>();
            BenchmarkSeries = new List<InvestmentBenchmarkSerie>();
            BenchmarkUnderlyingSeries = new List<InvestmentBenchmarkUnderlyingSerie>();
            TradedQuantities = new List<TradedQuantity>();
        }

        public int Id { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime LastSerieDate { get; set; }
        public DateTime? EndDate { get; set; }
        public int Side { get; set; }
        public bool Closed { get; set; }
        public int FundBookEntityId { get; set; }
        public Guid IdeaId { get; set; }
        public int Identity { get; set; }
        public byte Flags { get; set; }
        public int? ParentInvestmentId { get; set; }
        public DateTime? EnterPhaseEnd { get; set; }
        public DateTime? ExitPhaseStart { get; set; }
        
        [ForeignKey("FundBookEntityId")]
        public virtual FundBookEntity FundBookEntity { get; set; }

        [ForeignKey("IdeaId")]
        public virtual AnalyticsIdea Idea { get; set; }

        public virtual ICollection<InvestmentRiskSerie> RiskSeries { get; set; }

        public virtual ICollection<InvestmentSecuritySerie> SecuritySeries { get; set; }

        public virtual ICollection<InvestmentSecurityUnderlyingSerie> SecurityUnderlyingSeries { get; set; }

        public virtual ICollection<InvestmentBenchmarkSerie> BenchmarkSeries { get; set; }

        public virtual ICollection<InvestmentBenchmarkUnderlyingSerie> BenchmarkUnderlyingSeries { get; set; }

        public virtual ICollection<TradedQuantity> TradedQuantities { get; set; }
    }
}
